package ru.infosystem.client.frame;

import ru.infosystem.client.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Date;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import ru.infosystem.client.dao.GroupDAO;
import ru.infosystem.client.dao.StudentDAO;
import ru.infosystem.client.data.Group;
import ru.infosystem.client.data.ServerException;
import ru.infosystem.client.data.Student;
import ru.infosystem.client.listener.ClientFrameWindowListener;

public class ClientFrame extends javax.swing.JFrame {

    private BDConnection connection;
    private Properties properties = new Properties();
    private String properiesFile = "Client.conf";
    private StudentDialog studentDialog;
    private GroupDialog groupDialog;

    /**
     * Creates new form ClientFrame
     */
    public ClientFrame() {

        if (connect()) {


            initComponents();



            this.addWindowListener(new ClientFrameWindowListener(connection));

            this.setVisible(true);
        }
    }

    private boolean connect() {

        ProgressBar progressBar = new ProgressBar(this);
        boolean connect = false;

        while (!connect) {

            progressBar.setVisible(true);

            // init client configuration
            try {

                File pfile = new File(properiesFile);

                if (!pfile.exists()) {
                    pfile.createNewFile();
                }

                FileInputStream fileInputStream = new FileInputStream(pfile);
                properties.load(fileInputStream);

            } catch (IOException ex) {
                System.err.println("Couldn't init client: " + ex.getMessage());
            }

            // connect
            if (properties.getProperty("Port") != null) {

                connection = BDConnectionFactory
                        .getDBConnection(properties.getProperty("InetAddress"),
                        Integer.parseInt(properties.getProperty("Port")));
            }

            progressBar.setVisible(false);

            if (connection == null) {
                // error message


                int n = JOptionPane.showConfirmDialog(
                        this,
                        "Error connect, change options?",
                        "Error",
                        JOptionPane.YES_NO_OPTION,
                        JOptionPane.ERROR_MESSAGE);

                if (n == JOptionPane.YES_OPTION) {

                    JDialog optionBox = new OptionBox(this, true, properiesFile);
                    optionBox.setVisible(true);

                } else {

                    this.dispose();

                    return false;
                }

            } else {

                connect = true;
            }
        }

        return connect;
    }

    public void ConfirmDialog(String header, String message) {
        int n = JOptionPane.showConfirmDialog(
                this,
                message,
                header,
                JOptionPane.WARNING_MESSAGE);

        if (n == JOptionPane.NO_OPTION) {

            this.dispose();

        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jInternalFrame1 = new javax.swing.JInternalFrame();
        jScrollPane1 = new javax.swing.JScrollPane();
        workTable = new javax.swing.JTable();
        studentPanel = new javax.swing.JPanel();
        addStudentBtn = new javax.swing.JButton();
        deleteStudentBtn = new javax.swing.JButton();
        showStudentBtn = new javax.swing.JButton();
        findStudentBtn = new javax.swing.JButton();
        groupPanel = new javax.swing.JPanel();
        addGroupBtn = new javax.swing.JButton();
        deleteGroupBtn = new javax.swing.JButton();
        showGroupBtn = new javax.swing.JButton();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0));

        jInternalFrame1.setVisible(true);

        javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
        jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
        jInternalFrame1Layout.setHorizontalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jInternalFrame1Layout.setVerticalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(638, 405));

        workTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(workTable);

        studentPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Student"));
        studentPanel.setToolTipText("Student");
        studentPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        studentPanel.setName(""); // NOI18N

        addStudentBtn.setText("Add");
        addStudentBtn.setToolTipText("");
        addStudentBtn.setBorder(null);
        addStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        addStudentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentBtnActionPerformed(evt);
            }
        });

        deleteStudentBtn.setText("Delete");
        deleteStudentBtn.setToolTipText("");
        deleteStudentBtn.setBorder(null);
        deleteStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        deleteStudentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteStudentBtnActionPerformed(evt);
            }
        });

        showStudentBtn.setText("Show");
        showStudentBtn.setToolTipText("");
        showStudentBtn.setBorder(null);
        showStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        showStudentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                showStudentBtnActionPerformed(evt);
            }
        });

        findStudentBtn.setText("Find");
        findStudentBtn.setBorder(null);
        findStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        findStudentBtn.setPreferredSize(new java.awt.Dimension(59, 23));
        findStudentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findStudentBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout studentPanelLayout = new javax.swing.GroupLayout(studentPanel);
        studentPanel.setLayout(studentPanelLayout);
        studentPanelLayout.setHorizontalGroup(
            studentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(studentPanelLayout.createSequentialGroup()
                .addComponent(addStudentBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deleteStudentBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(showStudentBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(findStudentBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        studentPanelLayout.setVerticalGroup(
            studentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(studentPanelLayout.createSequentialGroup()
                .addGroup(studentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addStudentBtn)
                    .addComponent(deleteStudentBtn)
                    .addComponent(showStudentBtn))
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(studentPanelLayout.createSequentialGroup()
                .addComponent(findStudentBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        groupPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Group"));
        groupPanel.setToolTipText("Группа");
        groupPanel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        groupPanel.setName(""); // NOI18N

        addGroupBtn.setText("Add");
        addGroupBtn.setToolTipText("");
        addGroupBtn.setBorder(null);
        addGroupBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        addGroupBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addGroupBtnActionPerformed(evt);
            }
        });

        deleteGroupBtn.setText("Delete");
        deleteGroupBtn.setToolTipText("");
        deleteGroupBtn.setBorder(null);
        deleteGroupBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        deleteGroupBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteGroupBtnActionPerformed(evt);
            }
        });

        showGroupBtn.setText("Show");
        showGroupBtn.setToolTipText("");
        showGroupBtn.setBorder(null);
        showGroupBtn.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        showGroupBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                showGroupBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout groupPanelLayout = new javax.swing.GroupLayout(groupPanel);
        groupPanel.setLayout(groupPanelLayout);
        groupPanelLayout.setHorizontalGroup(
            groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(groupPanelLayout.createSequentialGroup()
                .addComponent(addGroupBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deleteGroupBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(showGroupBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
        );
        groupPanelLayout.setVerticalGroup(
            groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, groupPanelLayout.createSequentialGroup()
                .addGroup(groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(addGroupBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(deleteGroupBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(showGroupBtn, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 747, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addComponent(studentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(groupPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(6, 6, 6))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(studentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(groupPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void deleteStudentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteStudentBtnActionPerformed
        studentDialog = new StudentDialog(this, true);
        this.studentDialog.showDialog();
        if (this.studentDialog.addButtonPressed) {
            String surname = this.studentDialog.surname;
            String name = this.studentDialog.name;
            String patronymic = this.studentDialog.patronymic;
            int group = Integer.parseInt(this.studentDialog.group);
            Date date = Date.valueOf(this.studentDialog.date);
            try {
                Student st = new Student(name, surname, patronymic, group, date);
                boolean done = StudentDAO.deleteStudent(connection, st);
                if (done) {
                    this.ConfirmDialog("Success", "Student was deleted from database");
                } else {
                    this.ConfirmDialog("Error", "Student wasn't deleted from database");
                }
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            }
            try {
                // обновим информацию на экране
                workTable.setModel(StudentDAO.listByGroup(connection, new Group(Integer.valueOf(group), this.studentDialog.group.substring(0, 1), null)));
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            } catch (ClassNotFoundException ex) {
                this.ConfirmDialog("Error", "Program error expected");
            }
        }

    }//GEN-LAST:event_deleteStudentBtnActionPerformed

    private void deleteGroupBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteGroupBtnActionPerformed
        this.groupDialog = new GroupDialog(this, true);
        this.groupDialog.setVisible(true);
        if (this.groupDialog.addButtonPressed) {
            String groupNum = this.groupDialog.groupNum;
            String facultyNum = this.groupDialog.facultyNum;
            if (facultyNum.equals("")) {
                facultyNum = groupNum.substring(0, 1);
            }
            try {
                if (GroupDAO.deleteGroup(connection, new Group(Integer.valueOf(groupNum), facultyNum, null))) {
                    // обновим информацию на экране
                    workTable.setModel(GroupDAO.list(connection, facultyNum));
                    this.ConfirmDialog("Success", "Group succesfully deleted");
                } else {
                    this.ConfirmDialog("Error", "Group wasn't deleted");
                }
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            } catch (ClassNotFoundException c) {
                this.ConfirmDialog("Error", "Program error expected");
            }
        }
    }//GEN-LAST:event_deleteGroupBtnActionPerformed

    private void showStudentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showStudentBtnActionPerformed
        try {
            ShowStudentsDialog s = new ShowStudentsDialog(this, true);
            s.setVisible(true);
            if (s.showButtonPressed) {
                String groupNumber = s.number;
                // номер факультета - первая цифра группы
                workTable.setModel(StudentDAO.listByGroup(connection, new Group(Integer.valueOf(groupNumber), groupNumber.substring(0, 1), null)));
            }
        } catch (ServerException ex) {
            this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
        } catch (IOException ex) {
            Logger.getLogger(ClientFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            this.ConfirmDialog("Error", "IO Error expected");
        } catch (IllegalArgumentException ia) {
            this.ConfirmDialog("Error", "IO Error expected");
        }
    }//GEN-LAST:event_showStudentBtnActionPerformed

    private void addStudentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentBtnActionPerformed
        studentDialog = new StudentDialog(this, true);
        this.studentDialog.showDialog();
        if (this.studentDialog.addButtonPressed) {
            String surname = this.studentDialog.surname;
            String name = this.studentDialog.name;
            String patronymic = this.studentDialog.patronymic;
            int group = Integer.parseInt(this.studentDialog.group);
            Date date = Date.valueOf(this.studentDialog.date);
            try {
                Student st = new Student(name, surname, patronymic, group, date);
                boolean done = StudentDAO.addStudent(connection, st);

                if (done) {
                    this.ConfirmDialog("Success", "Student was added to database");
                } else {
                    this.ConfirmDialog("Error", "Student wasn't added to database");
                }
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            }
            try {
                // обновим информацию на экране
                workTable.setModel(StudentDAO.listByGroup(connection, new Group(Integer.valueOf(group), this.studentDialog.group.substring(0, 1), null)));
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            } catch (ClassNotFoundException ex) {
                this.ConfirmDialog("Error", "Program error expected");
            }

        }

    }//GEN-LAST:event_addStudentBtnActionPerformed

    private void addGroupBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addGroupBtnActionPerformed
        this.groupDialog = new GroupDialog(this, true);
        this.groupDialog.setVisible(true);
        if (this.groupDialog.addButtonPressed) {
            String groupNum = this.groupDialog.groupNum;
            String facultyNum = this.groupDialog.facultyNum;
            if (facultyNum.equals("")) {
                facultyNum = groupNum.substring(0, 1);
            }
            try {
                if (GroupDAO.addGroup(connection, new Group(Integer.valueOf(groupNum), facultyNum, null))) {
                    // обновим информацию на экране
                    workTable.setModel(GroupDAO.list(connection, facultyNum));
                    this.ConfirmDialog("Success", "Group successfully added");
                } else {
                    this.ConfirmDialog("Error", " Group wasn't added to database");
                }
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            } catch (ClassNotFoundException c) {
                this.ConfirmDialog("Error", "Program error expected");
            }
        }
    }//GEN-LAST:event_addGroupBtnActionPerformed

    private void showGroupBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showGroupBtnActionPerformed
        try {
            ShowGroupsDialog s = new ShowGroupsDialog(this, true);
            s.setVisible(true);
            if (s.showButtonPressed) {
                String facNumber = s.number;
                workTable.setModel(GroupDAO.list(connection, facNumber));
            }
        } catch (ServerException ex) {
            this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
        } catch (IOException ex) {
            this.ConfirmDialog("Error", "IO Error expected " + ex);
        } catch (ClassNotFoundException ex) {
            this.ConfirmDialog("Error", "IO Error expected");
        }
    }//GEN-LAST:event_showGroupBtnActionPerformed

    private void findStudentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findStudentBtnActionPerformed
        SearchDialog searchDialog = new SearchDialog(this, true);
        searchDialog.setVisible(true);
        if (searchDialog.findButtonPushed) {
            String template = searchDialog.template;
            try {
                this.workTable.setModel(StudentDAO.findStudents(connection, template));
            } catch (ServerException ex) {
                this.ConfirmDialog("Error", "Server-side error expected  " + ex.message);
            } catch (IOException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            } catch (ClassNotFoundException ex) {
                this.ConfirmDialog("Error", "IO Error expected");
            }
        }

    }//GEN-LAST:event_findStudentBtnActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addGroupBtn;
    private javax.swing.JButton addStudentBtn;
    private javax.swing.JButton deleteGroupBtn;
    private javax.swing.JButton deleteStudentBtn;
    private javax.swing.Box.Filler filler1;
    private javax.swing.JButton findStudentBtn;
    private javax.swing.JPanel groupPanel;
    private javax.swing.JInternalFrame jInternalFrame1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton showGroupBtn;
    private javax.swing.JButton showStudentBtn;
    private javax.swing.JPanel studentPanel;
    private javax.swing.JTable workTable;
    // End of variables declaration//GEN-END:variables
}
